package com.tigger.core.redisson;

import org.redisson.api.RLock;

import java.util.concurrent.TimeUnit;

/**
 * Created by root on 2018/7/21.
 */
public interface DistributedRReadWriteLocker extends DistributedLocker {

    boolean readLock(String lockKey);

    boolean writeLock(String lockKey);

    boolean readLock(String lockKey, TimeUnit unit, int timeout);

    boolean writeLock(String lockKey, TimeUnit unit, int timeout);

    boolean tryReadLock(String lockKey, TimeUnit unit, int waitTime, int leaseTime);

    boolean tryWriteLock(String lockKey, TimeUnit unit, int waitTime, int leaseTime);

    void unlock(String lockKey);

    void unlock(RLock lock);

    void releaseReadLock(String lockKey);

    void releaseWriteLock(String lockKey);
}
